package com.atguigu.contacts;
/**
 * 
 * @ClassName: YangHuiSanJiao
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author Administrator
 * @date 2021年8月12日
 *
 */
public class YangHuiSanJiao {
	
	public static void main(String[] args) {
		int[][] yanghui = new int[10][];
		// 初始化 优化搜索范围 显示一体
		for (int i = 0; i < yanghui.length; i++) {
			yanghui[i] = new int[i+1];
			yanghui[i][0] = 1;
			yanghui[i][i] = 1;
			for (int j = 0; j < yanghui[i].length; j++) {
				if (yanghui[i][j] == 0) {
					yanghui[i][j] = yanghui[i - 1][j] + yanghui[i-1][j-1];
				}
				System.out.print(yanghui[i][j] + "  ");
			}
			System.out.println();
		}
	}
}
